package com.noob.susu.excel.entity;

import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.List;

/**
 * @author shupeng_liao
 * @date 2019/12/12 15:24
 **/
@Getter
@Setter
public class ExcelModelResult<T> implements Serializable {

    /**
     * 是否成功
     */
    private Boolean success;

    /**
     * 对象
     */
    private T model;

    /**
     * 错误信息集合
     */
    private List<String> errorMessages;

    public ExcelModelResult(Boolean success, T model, List<String> errorMessages) {
        this.success = success;
        this.model = model;
        this.errorMessages = errorMessages;
    }

    public ExcelModelResult() {
    }


    public static <T> ExcelModelResult<T> getInstance() {
        return new ExcelModelResult<>(true, null, null);
    }

}
